#pragma once

// 单实例对象
class Settings {
public:
    ~Settings(){};
    static Settings* GetIns() {
        static Settings instance;
        return &instance;
    }
    void Debug();
    bool Has(std::string key);
    bool NotHas(std::string key);
    bool Set(std::string key, int value);
    bool Set(std::string key, float value);
    bool Set(std::string key, std::string value);
    int GetNum(std::string key);
    float GetFloat(std::string key);
    const std::string& GetString(std::string key);
    const char* GetCharPtr(std::string key);
private:
    Settings(){};

private:
    std::unordered_map<std::string, std::tuple<float, std::string>> _valueMap{};
};

#define SETTINGS Settings::GetIns()
#define S_GETS Settings::GetIns()->GetString
#define S_GETP Settings::GetIns()->GetCharPtr
#define S_GETN Settings::GetIns()->GetNum
#define S_GETF Settings::GetIns()->GetFloat
#define S_SET Settings::GetIns()->Set
#define S_HAS Settings::GetIns()->Has
#define S_NOT_HAS Settings::GetIns()->NotHas